package ModelLayer;

/**
 * Vestbjerg project
 * @GroupB2 (UCN - Computer Science DMAJ0914) 
 */
public class Employee extends Person
{
    //instance variables
    private int securityLvl;

    /**
     * Constructor for objects of class Employee
     */
    public Employee(String id, String name, String address, String phone, String email)
    {
        super(id,name,address,phone,email);
        setupSecurityLvl();
    }
      
    public int getSecurityLvl() 
    {
        return securityLvl;
    }

    private void setupSecurityLvl() 
    {
        String idSubstring = getId().substring(0,1);
        int idParsed = Integer.parseInt(idSubstring);
        if(idParsed >= 1 && idParsed <= 3) {
            securityLvl = idParsed;
        }
    }

}